package lambda_expression.jdk;

import java.util.StringJoiner;
import java.util.function.Consumer;
import java.util.function.Supplier;

public class RunnableTest {
    public static void main(String[] args) {
        Runnable r = new Runnable() {
            @Override
            public void run() {
                System.out.println("---runnale-----");
            }
        };

        r.run();

        System.out.println("==================================");

        Runnable r2 = () -> {
            System.out.println("-----runnable2-----");
        };
        r2.run();

        System.out.println("==============Supplier====================");

        Supplier<String> s = () -> "hello world";
        Consumer<String> c = str -> {
            System.out.println("Str: "+str);
        };
        System.out.println(s.get());
        c.accept("consumer test");


    }
}
